package com.nineclock.attendance.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.nineclock.attendance.dto.AttendCompanyCommonSettingDTO;
import com.nineclock.attendance.pojo.AttendCompanyCommonSetting;
import com.nineclock.attendance.service.AttendCompanyCommonSettingService;
import com.nineclock.attendance.mapper.AttendCompanyCommonSettingMapper;
import com.nineclock.common.filter.CurrentUserHolder;
import com.nineclock.common.utils.BeanHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author hezhaoqian
* @description 针对表【at_company_common_setting(公司通用设定 )】的数据库操作Service实现
* @createDate 2021-12-29 09:51:06
*/
@Service
public class AttendCompanyCommonSettingServiceImpl implements AttendCompanyCommonSettingService {

    @Autowired
    private AttendCompanyCommonSettingMapper companyCommonSettingMapper;
    @Override
    public List<AttendCompanyCommonSettingDTO> list() {
        LambdaQueryWrapper<AttendCompanyCommonSetting> wrapper=new LambdaQueryWrapper<>();
        wrapper.eq(AttendCompanyCommonSetting::getCompanyId, CurrentUserHolder.get().getCompanyId());
        List<AttendCompanyCommonSetting> list = companyCommonSettingMapper.selectList(wrapper);
        return BeanHelper.copyWithCollection(list,AttendCompanyCommonSettingDTO.class);
    }
}




